package jtk.project4.fleet.ibatis.dao;

import java.sql.SQLException;
import java.util.List;

import nl.coderight.jazz.dialog.MessageDialog;
import nl.coderight.jazz.dialog.MessageType;
import jtk.project4.fleet.domain.FuelTank;

public class FuelTankDao extends IbatisDao{
	
	public List selectFuelTank() throws SQLException {
		List selectFuelTank = null;
			selectFuelTank =getSqlMap().queryForList("SELECT_ALL_FUELTANK", null);
		return selectFuelTank;
	}
	
	
	public int deleteFuelTank(FuelTank fueltank) throws SQLException{
		return (int) getSqlMap().delete("DELETE_FuelTank", fueltank);
	}
	
	public int updateFuelTank(FuelTank fueltank) throws SQLException{
		return (int) getSqlMap().update("UPDATE_FuelTank", fueltank);
	}
	
	public FuelTank insertFuelTank(FuelTank fueltank) throws SQLException{
		return (FuelTank) getSqlMap().insert("INSERT_FUELTANK", fueltank);
	}
	
		
	public static void main (String args[]) throws SQLException{
		FuelTank fueltank;
		fueltank = new FuelTank();
		//fueltank.setDesc("balablablae");
		new FuelTankDao().insertFuelTank(fueltank);
		}
	
}